package com.eshop.modules.product.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

@TableName("store_product_attr")
public class StoreProductAttr implements Serializable
{
    @TableId
    private Long id;
    private Long productId;
    private String attrName;
    private String attrValues;
    
    public void copy(final StoreProductAttr source) {
        BeanUtil.copyProperties((Object)source, (Object)this, CopyOptions.create().setIgnoreNullValue(true));
    }
    
    public static StoreProductAttrBuilder builder() {
        return new StoreProductAttrBuilder();
    }
    
    public Long getId() {
        return this.id;
    }
    
    public Long getProductId() {
        return this.productId;
    }
    
    public String getAttrName() {
        return this.attrName;
    }
    
    public String getAttrValues() {
        return this.attrValues;
    }
    
    public void setId(final Long id) {
        this.id = id;
    }
    
    public void setProductId(final Long productId) {
        this.productId = productId;
    }
    
    public void setAttrName(final String attrName) {
        this.attrName = attrName;
    }
    
    public void setAttrValues(final String attrValues) {
        this.attrValues = attrValues;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof StoreProductAttr)) {
            return false;
        }
        final StoreProductAttr other = (StoreProductAttr)o;
        if (!other.canEqual(this)) {
            return false;
        }
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        Label_0065: {
            if (this$id == null) {
                if (other$id == null) {
                    break Label_0065;
                }
            }
            else if (this$id.equals(other$id)) {
                break Label_0065;
            }
            return false;
        }
        final Object this$productId = this.getProductId();
        final Object other$productId = other.getProductId();
        Label_0102: {
            if (this$productId == null) {
                if (other$productId == null) {
                    break Label_0102;
                }
            }
            else if (this$productId.equals(other$productId)) {
                break Label_0102;
            }
            return false;
        }
        final Object this$attrName = this.getAttrName();
        final Object other$attrName = other.getAttrName();
        Label_0139: {
            if (this$attrName == null) {
                if (other$attrName == null) {
                    break Label_0139;
                }
            }
            else if (this$attrName.equals(other$attrName)) {
                break Label_0139;
            }
            return false;
        }
        final Object this$attrValues = this.getAttrValues();
        final Object other$attrValues = other.getAttrValues();
        if (this$attrValues == null) {
            if (other$attrValues == null) {
                return true;
            }
        }
        else if (this$attrValues.equals(other$attrValues)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof StoreProductAttr;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $id = this.getId();
        result = result * 59 + (($id == null) ? 43 : $id.hashCode());
        final Object $productId = this.getProductId();
        result = result * 59 + (($productId == null) ? 43 : $productId.hashCode());
        final Object $attrName = this.getAttrName();
        result = result * 59 + (($attrName == null) ? 43 : $attrName.hashCode());
        final Object $attrValues = this.getAttrValues();
        result = result * 59 + (($attrValues == null) ? 43 : $attrValues.hashCode());
        return result;
    }
    
    @Override
    public String toString() {
        return "StoreProductAttr(id=" + this.getId() + ", productId=" + this.getProductId() + ", attrName=" + this.getAttrName() + ", attrValues=" + this.getAttrValues() + ")";
    }
    
    public StoreProductAttr(final Long id, final Long productId, final String attrName, final String attrValues) {
        this.id = id;
        this.productId = productId;
        this.attrName = attrName;
        this.attrValues = attrValues;
    }
    
    public StoreProductAttr() {
    }
    
    public static class StoreProductAttrBuilder
    {
        private Long id;
        private Long productId;
        private String attrName;
        private String attrValues;
        
        StoreProductAttrBuilder() {
        }
        
        public StoreProductAttrBuilder id(final Long id) {
            this.id = id;
            return this;
        }
        
        public StoreProductAttrBuilder productId(final Long productId) {
            this.productId = productId;
            return this;
        }
        
        public StoreProductAttrBuilder attrName(final String attrName) {
            this.attrName = attrName;
            return this;
        }
        
        public StoreProductAttrBuilder attrValues(final String attrValues) {
            this.attrValues = attrValues;
            return this;
        }
        
        public StoreProductAttr build() {
            return new StoreProductAttr(this.id, this.productId, this.attrName, this.attrValues);
        }
        
        @Override
        public String toString() {
            return "StoreProductAttr.StoreProductAttrBuilder(id=" + this.id + ", productId=" + this.productId + ", attrName=" + this.attrName + ", attrValues=" + this.attrValues + ")";
        }
    }
}
